package com.scvtc.controller.office;

import com.scvtc.domain.ResResult;
import com.scvtc.domain.entity.office.Examination;
import com.scvtc.domain.vo.PageVo;
import com.scvtc.service.office.OfficeExaminationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "考试信息(OfficeExaminationController)")
@RestController
@RequestMapping("officeExamination")
public class OfficeExaminationController {

    @Autowired
    OfficeExaminationService officeExaminationService;

    @GetMapping("/list")
    @ApiOperation("查询所有会议")
    public ResResult<PageVo<List<Examination>>> getAllTeacherSocialService(
            @RequestParam(defaultValue = "1") Long current,
            @RequestParam(defaultValue = "10") Long size,
            Examination partyExamination) {
        return officeExaminationService.getAllInfo(current, size,partyExamination);
    }

    @PostMapping("/")
    @ApiOperation("添加记录")
    public ResResult<?> addDocument(@RequestBody Examination partyExamination) {
        return officeExaminationService.addOneExamination(partyExamination);
    }


    @PutMapping("/")
    @ApiOperation("修改记录")
    public ResResult<?> updateDocument(@RequestBody Examination documention) {
        return officeExaminationService.updateExamination(documention);
    }

    @DeleteMapping("/")
    @ApiOperation("删除一条材料信息")
    public ResResult<?> deleteTeacher(Long id) {
        return officeExaminationService.deleteExamination(id);
    }

    @DeleteMapping("/multiple")
    @ApiOperation("删除多条教师信息")
    public ResResult<?> deleteMultipleTeacherBase(Long[] ids) {
        return officeExaminationService.deleteMultipleExamination(ids);
    }

}
